def is_palindrome(s: str) -> bool:
    """验证字符串是否为回文串（只考虑字母数字，忽略大小写）"""
    left, right = 0, len(s) - 1
    
    while left < right:
        # 移动左指针直到找到字母数字
        while left < right and not s[left].isalnum():
            left += 1
        # 移动右指针直到找到字母数字
        while left < right and not s[right].isalnum():
            right -= 1
        
        # 比较字符（忽略大小写）
        if s[left].lower() != s[right].lower():
            return False
        
        left += 1
        right -= 1
    
    return True

def main():
    import sys
    if len(sys.argv) != 2:
        print("Usage: python alg.py <input_file>")
        sys.exit(1)
    
    input_file = sys.argv[1]
    with open(input_file, 'r') as f:
        s = f.read().strip()
    
    result = is_palindrome(s)
    print(f"Is palindrome: {result}")

if __name__ == "__main__":
    main()    